const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const resolve = dir => {
  return path.join(__dirname, dir);
};

// 项目部署基础
const BASE_URL = process.env.NODE_ENV === "production" ? "/" : "/";

const sourceMap = process.env.NODE_ENV !== "production";

module.exports = {
  baseUrl: BASE_URL,
  // 如果你不需要使用eslint，把lintOnSave设为false即可
  lintOnSave: false,
  chainWebpack: config => {
    config.resolve.alias
      .set("@", resolve("src"))
      .set("@component", resolve("src/components"));
  },
  // 设为false打包时不生成.map文件
  productionSourceMap: sourceMap
};
